package com.kyrie.lib_sys.application.timeApplys.pojo.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 检验结果类
 *
 * @author heefM
 * @date 2025-
 */
@Data
public class ValidationResult {
    private boolean valid = true;
    private String message;
    private List<String> errors = new ArrayList<>();

    public boolean isValid() {
        return valid;
    }

    public void setValid(boolean valid) {
        this.valid = valid;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<String> getErrors() {
        return new ArrayList<>(errors);
    }

    public void addError(String error) {
        this.valid = false;
        this.errors.add(error);
    }
    public boolean hasErrors() {
        return !errors.isEmpty();
    }
}